﻿<%@ Page Title="Make Requisition From" Language="C#" MasterPageFile="~/View/Master.Master" AutoEventWireup="true" CodeBehind="StationeryRequisitionForm.aspx.cs" Inherits="PresentationLayer.View.DepartmentEmployee.StationeryRequisitionForm" %>

<%@ Register src="../mainMenu.ascx" tagname="mainMenu" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        
        .style1
        {
            width: 45px;
        }
        
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%">
    <tr>
        <td style="height:auto;width:200px;vertical-align:top;">
     
            <uc1:mainMenu ID="mainMenu1" runat="server" />
     
        </td>
        <td>


     <div style="vertical-align:top;">
    <center><h2><u>Stationery Requisition Form</u></h2></center>
    </div>
    <div>

        <asp:Panel ID="PanelMsg" runat="server" Visible="False">
            <center><asp:Label ID="lblmsg" runat="server" ForeColor="Black"></asp:Label></center>
        </asp:Panel>

    </div>
    <asp:Panel ID="PanelData" runat="server" Visible="False">            
    <div>        
    <table style="width: 72%;">
        <tr>
            <td align="left">
                Employee Name:</td>
            <td align="left">
                <asp:Label ID="lblEmployeeName" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="left">
                Employee Number:</td>
            <td align="left">
                <asp:Label ID="lblEmployeeNumber" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="left" >
                Department Code:
            </td>
            <td align="left" >
                <asp:Label ID="lblDepartmentCode" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="left">
                Email:
            </td>
            <td align="left">
                <asp:Label ID="lblEmail" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="left">
                Applied Date: 
            </td>
            <td align="left">
                <asp:Label ID="lblAppliedDate" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="left">
                Status:</td>
            <td align="left">
                <asp:Label ID="lblStatus" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="left">
                &nbsp;</td>
            <td align="left">
                &nbsp;</td>
        </tr>
        <tr>
            <td align="left">
                <asp:Button ID="btnAddStationeryItems" runat="server" 
                    onclick="btnAddStationeryItems_Click" Text="Add Stationery Items" 
                    CausesValidation="False" UseSubmitBehavior="False" />
            </td>
            <td align="left">
                &nbsp;</td>
        </tr>
    </table>
    </div>
    <br />
    <div>
    <table style="left: auto">
    <tr>
    <td >
    <div>
    <asp:GridView ID="ReqDetailsView" runat="server" autogeneratecolumns="False" 
        CellPadding="4" ForeColor="#333333" GridLines="None" 
        onrowdeleting="ReqDetailsView_RowDeleting" 
        onrowupdating="ReqDetailsView_RowUpdating" Width="850px" DataKeyNames="ItemId">
        <AlternatingRowStyle BackColor="White" />
        <columns>
            <asp:TemplateField HeaderText="No.">
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%#Container.DataItemIndex + 1 %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemStyle Width="50px" />
            </asp:TemplateField>
            <asp:BoundField DataField="ItemId" HeaderText="Item Number" >
            <ItemStyle Width="100px" />
            </asp:BoundField>
            <asp:BoundField DataField="ItemName" HeaderText="Item Name" >
            <ItemStyle Width="200px" />
            </asp:BoundField>
            <asp:BoundField DataField="OutStandingQty" HeaderText="Available Qty" >
            <ItemStyle Width="50px" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="Required Qty" ItemStyle-Width="100%">
                <ItemTemplate>
                    <table style="width: 40%;">
                        <tr>
                            <td class="style1">
                                <asp:TextBox ID="tbQty" runat="server" Height="25px" 
                                    MaxLength="3" Text='<%# Eval("RequestedQty") %>' Width="45px"></asp:TextBox>
                            </td>
                            <td>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                    ControlToValidate="tbQty" ErrorMessage="invalid input" ForeColor="Red" 
                                    ValidationExpression="^[1-9]+\d*$" Font-Bold="True"></asp:RegularExpressionValidator>
                                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                    ControlToCompare="tbAvailableQty" ControlToValidate="tbQty" 
                                    ErrorMessage="must less than available qty" Font-Bold="True" ForeColor="Red" 
                                    Operator="LessThanEqual" Type="Integer"></asp:CompareValidator>
                                <asp:TextBox ID="tbAvailableQty" runat="server" Enabled="False" Height="16px" 
                                    ReadOnly="True" Text='<%# Eval("OutStandingQty") %>' Visible="False" 
                                    Width="16px"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Width="200px" />
            </asp:TemplateField>
            <asp:ButtonField ButtonType="Button" CommandName="Update" Text="Update" 
                CausesValidation="True" >
            <ItemStyle Width="100px" />
            </asp:ButtonField>
            <asp:ButtonField ButtonType="Button" 
                CommandName="Delete" Text="Delete" >
            <ItemStyle Width="100px" />
            </asp:ButtonField>
        </columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    </div>
    </td>
    </tr>
    <tr>
    <td align="left">
        <asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click" 
            Text="Submit" Visible="False" Width="74px" UseSubmitBehavior="False" />
        &nbsp;&nbsp;
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        <br />
        </td>    
    </tr>
    </table>
    </div>
</asp:Panel>
</td>
</tr>
</table>





</asp:Content>
